Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODRefCntObject


Release

The Release method decrements an object's reference count by 1.

void Release ();
DISCUSSION
When you no longer need an object reference that you obtained by calling a factory method (for example, the draft's CreatePart or AcquirePart method), you should call the object's Release method. In addition, you should balance every call to the object's Acquire method with a call to its Release method.

OVERRIDING
Every subclass of ODRefCntObject has its own version of the Release method that tells the draft to release the object from memory if the object's reference count becomes 0. Your subclass of ODPart must override this method. The override method must call its inherited Release method at the beginning of its implementation.

SEE ALSO
The ODPart class (page 459).
"The Release Method" on page 113 in OpenDoc Cookbook.
Table 2-1 on page 90 in OpenDoc Programmer's Guide.
"Responding to a Removed Display Frame" on page 112 in OpenDoc Programmer's Guide.
"Removing an Embedded Frame" on page 122 in OpenDoc Programmer's Guide.
"Undo and Embedded Frames" on page 264 in OpenDoc Programmer's Guide.
"Using an Extension" on page 444 in OpenDoc Programmer's Guide.
"Reference-Counted Objects" on page 468 in OpenDoc Programmer's Guide.
"Lazy Internalization" on page 473 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help